package com.idrem.views.sync;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.idrem.R;

public class SyncMainAct extends Activity {
	private Button btn_sync_base_upload = null;
	private Button btn_sync_task_upload = null;

	@Override
	public void onCreate(Bundle paramBundle) {
		super.onCreate(paramBundle);
		setContentView(R.layout.syncmain);
		this.btn_sync_base_upload = ((Button) findViewById(R.id.btn_syncbase_upload));
		this.btn_sync_task_upload = ((Button) findViewById(R.id.btn_synctask_upload));

		BtnListener btnListener = new BtnListener();
		this.btn_sync_base_upload.setOnClickListener(btnListener);
		this.btn_sync_task_upload.setOnClickListener(btnListener);
	}

	private class BtnListener implements View.OnClickListener {

		public void onClick(View v) {
			if (v.getId() == R.id.btn_syncbase_upload)
				SyncMainAct.this.progressDialog(1);
			if (v.getId() == R.id.btn_synctask_upload)
				SyncMainAct.this.progressDialog(2);
		}
	}

	private void progressDialog(int paramInt) {
		switch (paramInt) {
		case 1:
			// get base data from server
			Toast.makeText(SyncMainAct.this, "get base data from server",
					Toast.LENGTH_SHORT).show();
			break;
		case 2:
			// get task data from server
			Toast.makeText(SyncMainAct.this, "get task data from server",
					Toast.LENGTH_SHORT).show();
			break;

		default:
			break;
		}
	}
}